#Source file

TEST_SRC = test_fstm.cpp
LIB_SRC = fast_stm.cpp
#Object file
TEST_OBJ = $(TEST_SRC:.cpp=.o)
LIB_OBJ = $(LIB_SRC:.cpp=.o)

#Output execution file
STM_TEST = test_fstm.bin
STM_LIB = libfstm.a

#Compiler
CC = g++
AR = ar

#Include
INCLUDE = -I/usr/include
#Linker Parameter
LINKPARAM = -L./ -lpthread -lfstm
#Options for development
CFLAGS = -ansi -g -Wall -std=c++0x
#Options for release
#CFLAGS = -ansi -O -Wall

all: $(STM_TEST)

lib: $(STM_LIB)

$(STM_LIB): $(LIB_OBJ)
	$(AR) cq $@ $^

$(STM_TEST): $(TEST_OBJ) $(STM_LIB)
	$(CC) -o $(STM_TEST) $(LINKPARAM) $(TEST_OBJ)  

.SUFFIXES = .cpp

.cpp.o:
	$(CC) $(INCLUDE) $(CFLAGS) -c $<

clean:
	rm *.o

